Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
"getWatchLength" is not defined on the instance but referenced during render. Make sure to declare reactive data vue js properties in the data option

I've a vuex store which stores the state of the length of watched products, I get the length of product in my store but each time I try to {{getWatchlength}} in my code i get "getWatchlength" not defined

This the error I get in my console https://imageshack.com/i/pmlnoX9nj

This my vuex store https://imageshack.com/i/pmP87O5Ij I'm getting the length in my store

This my html code

<template>
  <div id="app">
    {{ getWatchLength }}
    <router-view></router-view>
  </div>
</template>

My script tag

<script>
import { mapActions } from "vuex";
import { mapGetters } from "vuex";
export default {
  name: "app",
  data() {
    return {
      categoryID: null,
      categories: [],
      products: [],
      show: null
    };
  },
  computed: {
    ...mapGetters( ["getWatchLength"], ["isLoggedIn"])
  }
};
</script>

Please, I don't know what I'm doing wrong

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try like following:

import { mapGetters, mapActions } from 'vuex';

computed: {
  ...mapGetters(["getWatchLength", "isLoggedIn"])
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!